package com.aaa.controller;

import com.aaa.service.UserService;
import com.aaa.vo.Result;
import com.aaa.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: qy158-system
 * @description:
 * @author: 闫克起2
 * @create: 2022-10-11 09:29
 **/
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    //如果使用了@RequestBody 那么请求方式必须为post
    @PostMapping("/list")
    public Result list(@RequestParam(defaultValue = "1")Integer currentPage,
                       @RequestParam(defaultValue = "5")Integer pageSize,
                       @RequestBody UserVo userVo
                       ){
        return userService.findByCondition(currentPage,pageSize,userVo);
    }
}


















